# nums = [3,30,34,5,9]
nums=[0,0,0]

def largestNumber(nums):
    #结果存放的字符串
    if len(nums)==1:
        return str(nums[0])
    elems=[]
    for i in nums:
        elems.append(str(i))
    elemsLen=len(elems)
    #采用冒泡排序的方法来确定位置
    for i in range(elemsLen-1):
        for j in range(0,elemsLen-i-1):
            if elems[j]+elems[j+1]<elems[j+1]+elems[j]:
                #j在前面的数值小于j+1在前面的数值
                elems[j],elems[j+1]=elems[j+1],elems[j]
    print(elems)
    res=""
    for i in elems:
        res+=i
    if res[0]=='0':
        return '0'
    else:
        return res
print(largestNumber(nums))